import { Component, OnInit } from '@angular/core';
import { FormGroup, FormControl, Validators } from '@angular/forms';
import { NzModalSubject } from 'ng-zorro-antd';

@Component({
  selector: 'ege-import-data',
  templateUrl: './import-data.component.html',
  styleUrls: ['./import-data.component.scss']
})
export class ImportDataComponent implements OnInit {

  _loading: boolean = false;

  _formGroup: FormGroup;

  constructor(
    private subject: NzModalSubject
  ) { }

  ngOnInit() {
    this._formGroup = new FormGroup({
      layerName: new FormControl('', Validators.required),
      uploadToServer: new FormControl(false, Validators.required),
      show: new FormControl(true, Validators.required)
    });
  }

  submitForm(): void {

  }

  handleChange(event): void {
    console.log(event);
  }

  handleConfirm(): void {
    this._loading = true;
  }

  handleCancel(): void {
    this.subject.destroy('onCancel');
  }

}
